<template>
  <div>
    <KanbanViewer :kanban-fetch-fn="fetchKanbanFn" />
  </div>
</template>

<script lang="ts" setup>
  import { KanbanViewer } from '@eacloud/kanban';

  import { getKanbanNodeById } from '@/api/report/kanban';

  defineOptions({ name: 'KanbanViewer' });

  /** 请求看板数据 */
  async function fetchKanbanFn(id: any) {
    const result = await getKanbanNodeById(id);
    return result?.Content ? JSON.parse(result.Content) : {};
  }
</script>
